<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="../../mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>添加新地址</title>
    <t:base type="jquery"></t:base>
    <script type="text/javascript" src="webpage/com/wx/added_product/procurement/shoppingCar.js"></script>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>

    <script type="text/javascript" charset="utf-8">
        mui.init();
    </script>

</head>
<body>
<div class="tel"><a href="tel:400-88-22726"> <img src="${webRoot }images/tel.jpg"></a></div>
<t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table"
             action="cbsInvoiceInfoController.do?doAdd" tiptype="tipType"  validFormName="validFormName" showAllError="false" callback="subCallBack" ignoreHidden="true">
    <input type="hidden" name="id" value="${ad.id}"/>
    <input type="hidden" name="genre" value="<%=StaticValue.DIC_GENRE_CINEMA%>"/>
    <%--<input type="hidden" id="invoiceGenre" name="invoiceGenre" value="${ad.invoiceGenre}"/>--%>
    <div class="mui-card" style="width:100%;margin:0px;">
        <ul class="mui-table-view">
            <%--<li class="mui-table-view-cell"><span--%>
                    <%--style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">发票类型--%>
			<%--</span>--%>
                <%--<div class="mui-input-row mui-radio mui-left ra">--%>
                    <%--<label style="line-height: 1.5;">专用</label> <input name="genreRadio"--%>
                                                                       <%--value="<%=StaticValue.DIC_INVOICE_GENRE_DEDICATED%>"--%>
                                                                       <%--type="radio" style="top: 0;" checked>--%>
                <%--</div>--%>
                <%--<div class="mui-input-row mui-radio mui-left ra">--%>
                    <%--<label style="line-height: 1.5;">普通</label> <input name="genreRadio"--%>
                                                                       <%--value="<%=StaticValue.DIC_INVOICE_GENRE_ORDINARY%>"--%>
                                                                       <%--type="radio" style="top: 0;" >--%>
                <%--</div>--%>
                <%--<c:if test="${not empty edit}">--%>
                    <%--<script type="text/javascript">--%>
                        <%--$(function(){--%>
                            <%--$("input[name='genreRadio']").attr("disabled","disabled");--%>
                        <%--})--%>
                    <%--</script>--%>
                <%--</c:if>--%>
            <%--</li>--%>
            <li class="mui-table-view-cell pt" >
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">发票抬头 </span>
                <div class="mui-input-row">
                    <input id='invoiceTitle' name="invoiceTitle" type="text" class=" mui-input" datatype="*5-30" nullmsg="请填写发票抬头信息"  ignore="ignore"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.invoiceTitle}">
                </div>
            </li>
            <li class="mui-table-view-cell zy">
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">税号 </span>
                <div class="mui-input-row">
                    <input id='clientTaxnum' name="clientTaxnum" type="text" class=" mui-input"
                           nullmsg="请填写税号" datatype="*2-50"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.clientTaxnum}">
                </div>
            </li>
            <li class="mui-table-view-cell zy" style="margin-top: 0;">
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px;text-align: right; padding-right: 10px">银行名称</span>
                <div class="mui-input-row">
                    <input id='clientBankname' name="clientBankname" type="text" class=" mui-input" datatype="*5-20" nullmsg="请填写银行名称" errormsg="银行名称有误"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.clientBankname}">
                </div>
            </li>
            <li class="mui-table-view-cell zy">
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">银行账号 </span>
                <div class="mui-input-row">
                    <input id='clientBankaccount' name="clientBankaccount" type="text" class=" mui-input" datatype="*5-21" nullmsg="银行账号"  ignore="ignore"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.clientBankaccount}">
                </div>
            </li>
            <li class="mui-table-view-cell zy">
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">公司抬头 </span>
                <div class="mui-input-row">
                    <input id='clientName' name="clientName" type="text" class=" mui-input"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.clientName}">
                </div>
            </li>
            <li class="mui-table-view-cell zy">
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">客户地址 </span>
                <div class="mui-input-row">
                    <input id='clientAddress' name="clientAddress" type="text" class=" mui-input"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.clientAddress}">
                </div>
            </li>
            <li class="mui-table-view-cell zy">
                <span style="width: 100px; float: left; line-height: 40px; font-size: 14px; text-align: right; padding-right: 10px;">电话 </span>
                <div class="mui-input-row">
                    <input id='clientPhone' name="clientPhone" type="text" class=" mui-input"
                           style="width:90%; margin-bottom: 0; height: 30px; margin: 5px 0; font-size: 14px;"
                           value="${ad.clientPhone}">
                </div>
            </li>

            <%--<li class="mui-table-view-cell" style="margin-top: 0;">--%>
                <%--<span style="width: 100px; float: left; line-height: 40px; font-size: 14px;text-align: right; padding-right: 10px">是否默认</span>--%>
                <%--<div id='switch-div' class="mui-switch mui-switch-mini">--%>
                    <%--<div class="mui-switch-handle"></div>--%>
                <%--</div>--%>
                <%--<input type="hidden" id="isDefault" name="isDefault" value="${ad.isDefault}"/>--%>
            <%--</li>--%>
        </ul>
    </div>
    <div class="mui-clearfix"></div>
    <div style="width:92%;margin: 1em auto;">
        <a class="mui-btn mui-btn-block mui-btn-primary" href="javascript:saveAddress();" id="subOrder" style="font-size:1.6em !important;">确认</a>
    </div>
</t:formvalid>
</body>
<script type="text/javascript">
    /**验证提示*/
    function tipType(msg,o,cssctl){
        if(o.type == 3){
            mui.toast(msg);
        }
    }
    function subCallBack(data) {
        mui.openWindow({
            createNew : true,
            url: 'shoppingcar.do?goInvoice',
        })
    }
    function saveAddress() {
        $("#formobj").submit();
    }

    $(function(){

        <%--$("input[name='genreRadio']").click(function () {--%>
            <%--$("#invoiceGenre").val($(this).val());--%>
            <%--if($(this).val() == "<%=StaticValue.DIC_INVOICE_GENRE_DEDICATED%>"){--%>
                <%--$(".zy").show();--%>
                <%--$(".pt").hide();--%>
            <%--}else{--%>
                <%--$(".zy").hide();--%>
                <%--$(".pt").show();--%>
            <%--}--%>
        <%--})--%>

        if($("#isDefault").val() == '1'){
            $("#switch-div").addClass("mui-active");
        }
        $("#isDefault").val("${ad.isDefault}" || 0);

        document.getElementById("switch-div").addEventListener("toggle",function(event){
            if(event.detail.isActive){
                $("#isDefault").val(1);
            }else{
                $("#isDefault").val(0);
            }
        })
    })
</script>
</html>